package com.tlxch.controller.student;

import com.tlxch.pojo.SAttitude;
import com.tlxch.result.Result;
import com.tlxch.server.student.SAttiudeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "学习态度相关接口")
@Slf4j
@RestController
@RequestMapping("/student/attiude")
public class SAttiudeController {
    @Autowired
    SAttiudeService sAttiudeService;

    @GetMapping("/getbySidandType")
    @ApiOperation("查看学习态度记录")
    public Result<List<SAttitude>> getbySidandType(String sid, int type) {
        List<SAttitude> list = sAttiudeService.getbySidandType(sid, type);
        return Result.success(list);
    }

    @GetMapping("/getlist")
    @ApiOperation("获取他人评价自己的态度")
    public Result<List<SAttitude>> getlist(String sname,String major,int grade) {
        List<SAttitude> list = sAttiudeService.getlist(sname,major,grade);
        return Result.success(list);
    }
}
